#include "drv_wifi.h"

void drv_wifi_init(void)
{
	char cmd_1[]="AT+CWMODE=1\r\n";
	char cmd_2[]="AT+CWJAP_DEF=\"hqyjcs\",\"hqyj2022\"\r\n";//连接wifi
	char cmd_3[]="AT+CIPSTART=\"TCP\",\"192.168.91.107\",7777\r\n";//连接服务器
	char cmd_4[]="AT+CIPSEND=5\r\n";//接下来要发送5个字节数据

	usart_sendstr(USART3,cmd_1,strlen(cmd_1));
	drv_systick_ms(2000);
	usart_sendstr(USART3,cmd_2,strlen(cmd_2));
	drv_systick_ms(7000);
	usart_sendstr(USART3,cmd_3,strlen(cmd_3));
	drv_systick_ms(3000);
	usart_sendstr(USART3,cmd_4,strlen(cmd_4));
	drv_systick_ms(3000);
}

